﻿@model Telerik.Web.Mvc.GridModel<FixedRateModel>
@using Telerik.Web.Mvc.UI;
@using SmartStore.Shipping.Models;
@{
	Layout = "";
}

<div>
	@(Html.Telerik().Grid<FixedRateModel>(Model.Data)
		.Name("Grid")
		.DataKeys(keys => keys.Add(x => x.ShippingMethodId).RouteKey("ShippingMethodId"))
		.Columns(columns =>
		{
			columns.Bound(x => x.ShippingMethodName)
				.ReadOnly()
				.Width("80%"); ;
			columns.Bound(x => x.Rate)
				.Format("{0:0.00}")
				.Width("8%");
			columns.Command(commands =>
			{
				commands.Edit();
			}).Width("12%")
			.HtmlAttributes(new { align = "right", @class = "omega" });
		})
		.DataBinding(dataBinding =>
		{
			dataBinding.Ajax()
				.Select("Configure", "FixedRate", new RouteValueDictionary() { { "Namespaces", "SmartStore.Shipping.Controllers" }, { "area", "SmartStore.Shipping" } })
				.Update("ShippingRateUpdate", "FixedRate", new RouteValueDictionary() { { "Namespaces", "SmartStore.Shipping.Controllers" }, { "area", "SmartStore.Shipping" } });
		})
		.Editable(x => { x.Mode(GridEditMode.InLine); })
		.EnableCustomBinding(true))
</div>
